package com.xpec.c4.net.codec;

import net.sf.cindy.Packet;
import net.sf.cindy.PacketDecoder;
import net.sf.cindy.Session;

import com.xpec.c4.codec.amf3.Amf3Codec;

/**
 * AMF3解码器
 * @author lipeilin
 *
 */
public class Amf3Decoder implements PacketDecoder {

	Amf3Codec codec =new Amf3Codec();

	@Override
	public Object decode(Session session, Packet packet) throws Exception {
		Object obj = codec.decode(packet.getContent().asByteBuffer());
		packet.getContent().position(packet.getContent().limit());
		return obj;
	}

}
